<?php 
	include "header.html";
?>
<script type="text/javascript" src="framework/js/util.js"></script>
<!--link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css"/-->
<script src="js/table/jquery.dataTables.min.js"></script>
<script src="js/jquery-ui/jquery.ui.datepicker.min.js"></script>
<script type="text/javascript" src="js/jquery-ui/jquery.ui.dialog.min.js"></script>  
<script>
var maquinas;
var estados;
var tipos;

$(document).ready(function(){
	jQuery.ajaxSetup({async:false});
	armaTabla();
});

function armaTabla(){
	var ret;
	var params={};		
	mats=loadMap("matriceria",params,"numero");
	items=load("matriceria_control",params)

	var str="<table id='control'><thead><th>Fecha</th><th>Matriz</th><th>Orden</th><th>Codigo Pieza</th><th>Opciones</th></thead><tbody>";
	for (x=0;x<items.rowCount;x++){
		var obj=items.rows[x];		
		str += "<tr><td>" + obj.fecha + "</td><td>" + mats[obj.idMatriceria] + "</td><td>" + obj.numeroOrden + "</td><td>" + obj.codigoPieza + "</td><td><a href='registroControlMatriceria.php?id=" + obj.id + "'>Ver/Editar</a> &nbsp;</td></tr>";
	}			
	str+="</tbody></table>";
	$("#containerMatriceria").html(str);
	ret=setTable("control",0);
		
	return ret;
}
function borrarItem(idItem){
	confirmaBorra("Esta seguro de eliminar este Item?","matriceria_item",idItem);
	var idMatriceria=$("#idMatriceriaWork").val();
	armaTablaItems(idMatriceria);
}



</script>
		<input type="hidden" id="idItemWork"/>
		<input type="hidden" id="idMatriceriaWork"/>
		<div id="dialogDiv"></div>
<?php 
	include "menuMatriceria.html";
?>
        <div class="container_12">
           <div class="grid_10">
            	<div class="box round first">
                <h2>Matriceria</h2>
                	<div class="block">
	                     <div id="containerMatriceria"></div>
					</div>
				</div> 
			</div>                  		
       </div>
          

    <?php include "footer.html"?>